﻿using System.Collections.Generic;
using System.Threading.Tasks;
using BCEntity.OA.Attendance.AttendanceClass;
using BCEntity.OA.Attendance.AttendanceClassSetting;

namespace BCData.OA.Attendance.AttendanceClass
{
    /// <summary>
    /// 考勤班次
    /// </summary>
    public interface IAttendanceClassData
    {
        /// <summary>
        /// 获取班次信息
        /// </summary>
        /// <param name="classId">班次Id</param>
        /// <returns></returns>
        Task<AttendanceClassEntity> GetEntityAsync(long classId);
        
        /// <summary>
        /// 删除班次信息
        /// </summary>
        /// <param name="classId">班次Id</param>
        /// <param name="adminName">管理员</param>
        /// <returns></returns>
        Task<int> DeleteAsync(long classId, string adminName = null);

        /// <summary>
        ///分页查看考勤班次相关数据
        /// </summary>
        /// <param name="pageIndex">起始页</param>
        /// <param name="pageSize">页数量</param>
        /// <param name="ascending">排序</param>
        /// <returns>字典数据列表</returns>
        Task<(IEnumerable<AttendanceClassEntity>, int)> GetAsync(int pageIndex, int pageSize, bool ascending, string className);

        /// <summary>
        /// 新增考勤班次
        /// </summary>
        /// <param name="attendanceClass"></param>
        /// <returns></returns>
        Task<AttendanceClassEntity> InsertAsync(AttendanceClassEntity attendanceClass, List<AttendanceClassSettingEntity> attendanceClassSettings = null);

        /// <summary>
        /// 校验班次信息存在不
        /// </summary>
        /// <param name="classId">班次Id</param>
        /// <returns></returns>
        Task<bool> CheckIsExist(long classId);

        /// <summary>
        /// 修改考勤班次
        /// </summary>
        /// <param name="attendanceClass"></param>
        /// <returns></returns>
        Task<AttendanceClassEntity> UpdateAsync(AttendanceClassEntity attendanceClass, List<AttendanceClassSettingEntity> attendanceClassSettings = null);

        /// <summary>
        /// 获取考勤班次以及班次设置信息
        /// </summary>
        /// <param name="classId">班次Id</param>
        /// <returns></returns>
        Task<IEnumerable<AttendanceClassViewEntity>> GetAttendanceClassWithSettings(long classId);
    }
}
